<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template/sitemaster.xhtml"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:h="http://java.sun.com/jsf/html">

    <ui:define name="header">
        Book
    </ui:define>

    <ui:define name="content">
        <f:metadata>
            <f:viewParam name="id" value="#{categoryBean.categoryID}"/>
        </f:metadata>
        <c:forEach var="category" items="#{categoryBean.allBookByCategoryID}">
            <center>
                <table>
                    <tr>
                        <td>
                            <img src="#{category.images}"></img>
                        </td>

                    </tr>
                    <tr>
                        <td>#{category.name}</td><br/>
                    </tr>
                    <tr>
                        <td>#{category.author}</td>
                    </tr>
                    <tr>
                        <td>#{category.price} USD</td>
                    </tr>
                    <tr>
                        <td><h:button value="Detail" outcome="BookDetails.xhtml?id=#{category.id}"/></td>
                        <td></td>
                    </tr>
                </table> 
            </center>
        </c:forEach>
    </ui:define>

</ui:composition>
